\section{RtAudio::StreamOptions Struct Reference}
\label{struct_rt_audio_1_1_stream_options}\index{RtAudio::StreamOptions@{RtAudio::StreamOptions}}


The structure for specifying stream options.  




{\ttfamily \#include $<$RtAudio.h$>$}

\subsection*{Public Attributes}
\begin{DoxyCompactItemize}
\item 
{\bf RtAudioStreamFlags} {\bf flags}
\item 
unsigned int {\bf numberOfBuffers}
\item 
std::string {\bf streamName}
\item 
int {\bf priority}
\end{DoxyCompactItemize}


\subsection{Detailed Description}
The structure for specifying stream options. The following flags can be OR'ed together to allow a client to make changes to the default stream behavior:


\begin{DoxyItemize}
\item {\itshape RTAUDIO\_\-NONINTERLEAVED:\/} Use non-\/interleaved buffers (default = interleaved).
\item {\itshape RTAUDIO\_\-MINIMIZE\_\-LATENCY:\/} Attempt to set stream parameters for lowest possible latency.
\item {\itshape RTAUDIO\_\-HOG\_\-DEVICE:\/} Attempt grab device for exclusive use.
\item {\itshape RTAUDIO\_\-SCHEDULE\_\-REALTIME:\/} Attempt to select realtime scheduling for callback thread.
\end{DoxyItemize}

By default, \doxyref{RtAudio}{p.}{class_rt_audio} streams pass and receive audio data from the client in an interleaved format. By passing the RTAUDIO\_\-NONINTERLEAVED flag to the \doxyref{openStream()}{p.}{class_rt_audio_afacc99740fa4c5606fb35467cdea6da8} function, audio data will instead be presented in non-\/interleaved buffers. In this case, each buffer argument in the RtAudioCallback function will point to a single array of data, with {\ttfamily nFrames} samples for each channel concatenated back-\/to-\/back. For example, the first sample of data for the second channel would be located at index {\ttfamily nFrames} (assuming the {\ttfamily buffer} pointer was recast to the correct data type for the stream).

Certain audio APIs offer a number of parameters that influence the I/O latency of a stream. By default, \doxyref{RtAudio}{p.}{class_rt_audio} will attempt to set these parameters internally for robust (glitch-\/free) performance (though some APIs, like Windows Direct Sound, make this difficult). By passing the RTAUDIO\_\-MINIMIZE\_\-LATENCY flag to the \doxyref{openStream()}{p.}{class_rt_audio_afacc99740fa4c5606fb35467cdea6da8} function, internal stream settings will be influenced in an attempt to minimize stream latency, though possibly at the expense of stream performance.

If the RTAUDIO\_\-HOG\_\-DEVICE flag is set, \doxyref{RtAudio}{p.}{class_rt_audio} will attempt to open the input and/or output stream device(s) for exclusive use. Note that this is not possible with all supported audio APIs.

If the RTAUDIO\_\-SCHEDULE\_\-REALTIME flag is set, \doxyref{RtAudio}{p.}{class_rt_audio} will attempt to select realtime scheduling (round-\/robin) for the callback thread. The {\ttfamily priority} parameter will only be used if the RTAUDIO\_\-SCHEDULE\_\-REALTIME flag is set. It defines the thread's realtime priority.

The {\ttfamily numberOfBuffers} parameter can be used to control stream latency in the Windows DirectSound, Linux OSS, and Linux Alsa APIs only. A value of two is usually the smallest allowed. Larger numbers can potentially result in more robust stream performance, though likely at the cost of stream latency. The value set by the user is replaced during execution of the \doxyref{RtAudio::openStream()}{p.}{class_rt_audio_afacc99740fa4c5606fb35467cdea6da8} function by the value actually used by the system.

The {\ttfamily streamName} parameter can be used to set the client name when using the Jack API. By default, the client name is set to RtApiJack. However, if you wish to create multiple instances of \doxyref{RtAudio}{p.}{class_rt_audio} with Jack, each instance must have a unique client name. 

\subsection{Member Data Documentation}
\index{RtAudio::StreamOptions@{RtAudio::StreamOptions}!flags@{flags}}
\index{flags@{flags}!RtAudio::StreamOptions@{RtAudio::StreamOptions}}
\subsubsection[{flags}]{\setlength{\rightskip}{0pt plus 5cm}{\bf RtAudioStreamFlags} {\bf RtAudio::StreamOptions::flags}}\label{struct_rt_audio_1_1_stream_options_a0ecc98b031aa3af49d09b781643e298b}
A bit-\/mask of stream flags (RTAUDIO\_\-NONINTERLEAVED, RTAUDIO\_\-MINIMIZE\_\-LATENCY, RTAUDIO\_\-HOG\_\-DEVICE). \index{RtAudio::StreamOptions@{RtAudio::StreamOptions}!numberOfBuffers@{numberOfBuffers}}
\index{numberOfBuffers@{numberOfBuffers}!RtAudio::StreamOptions@{RtAudio::StreamOptions}}
\subsubsection[{numberOfBuffers}]{\setlength{\rightskip}{0pt plus 5cm}unsigned int {\bf RtAudio::StreamOptions::numberOfBuffers}}\label{struct_rt_audio_1_1_stream_options_a75a14cfab903d0e1c091bc16aec80240}
Number of stream buffers. \index{RtAudio::StreamOptions@{RtAudio::StreamOptions}!priority@{priority}}
\index{priority@{priority}!RtAudio::StreamOptions@{RtAudio::StreamOptions}}
\subsubsection[{priority}]{\setlength{\rightskip}{0pt plus 5cm}int {\bf RtAudio::StreamOptions::priority}}\label{struct_rt_audio_1_1_stream_options_adfd267059434edb21573c584e6367def}
Scheduling priority of callback thread (only used with flag RTAUDIO\_\-SCHEDULE\_\-REALTIME). \index{RtAudio::StreamOptions@{RtAudio::StreamOptions}!streamName@{streamName}}
\index{streamName@{streamName}!RtAudio::StreamOptions@{RtAudio::StreamOptions}}
\subsubsection[{streamName}]{\setlength{\rightskip}{0pt plus 5cm}std::string {\bf RtAudio::StreamOptions::streamName}}\label{struct_rt_audio_1_1_stream_options_a2a4b0b8d690c624d20f4e8f4be6ca9ba}
A stream name (currently used only in Jack). 

The documentation for this struct was generated from the following file:\begin{DoxyCompactItemize}
\item 
Include/{\bf RtAudio.h}\end{DoxyCompactItemize}
